package ar.com.fiuba.application.impl;

import javax.persistence.EntityManagerFactory;

import org.springframework.orm.jpa.support.JpaDaoSupport;
import org.springframework.transaction.annotation.Transactional;

import ar.com.fiuba.application.api.GenericDao;

public class GenericDaoImpl<T> extends JpaDaoSupport implements GenericDao<T> {

	private EntityManagerFactory entityManagerFactory;
	
	@Transactional
	public void save(T t) {
		this.getJpaTemplate().persist(t);
	}
	
	public EntityManagerFactory getEntityManagerFactory() {
		return entityManagerFactory;
	}
	
}
